'use strict';

var React = require('react-native');

var {
  StyleSheet,
  View,
  ActivityIndicatorIOS,
} = React;

var TimerMixin = require('react-timer-mixin');

var ActivityView = React.createClass({

  mixins: [TimerMixin],

  getInitialState: function() {
    return {
      animating: true,
    }
  },

  setToggleTimeout: function() {
    // this.setTimeout(
    //   () => {
    //     this.setState({animating: !this.state.animating});
    //     this.setToggleTimeout();
    //   },
    //   1200
    // );
  },

  componentDidMount: function() {
    this.setToggleTimeout();
  },


  render: function() {
      return(
        <ActivityIndicatorIOS
          animating = {this.state.animating}
          style = {[styles.centering, {height: 100}]}
          size = 'small'
          color = 'orange'/>
      );
  },
});

// exports.displayname = (undefined:? string);
// exports.framework = 'React';
// exports.title = '<ActivityIndicatorIOS>';
// exports.description = 'Animated loading indicators.';


var styles = StyleSheet.create({
  centering: {
    alignItems: 'center',
    justifyContent: 'center',
  },
  gray: {

  },
});

module.exports = ActivityView;
